package com.sskj.mine.presenter;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.SPUtil;
import com.sskj.lib.SPConfig;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.mine.MineInviteActivity;
import com.sskj.mine.bean.InviteInfo;
import com.sskj.mine.http.HttpConfig;


public class MineInviteActivityPresenter extends BasePresenter<MineInviteActivity> {

    public void getShareInfo() {
        OkGo.<HttpData<InviteInfo>>get(HttpConfig.BASE_URL + HttpConfig.INVITE)
                .params("id", SPUtil.get(SPConfig.ID,""))
                .execute(new JsonCallBack<HttpData<InviteInfo>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<InviteInfo>> response) {
                        HttpData<InviteInfo> body = response.body();
                        if (body.getStatus() == HttpConfig.OK) {
                            mView.updateUi(body.getData());
                        }
                    }
                });
    }


}
